<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>{$web_name}</title>
		<meta name="keywords" content="{$web_keyword}">
		<meta name="description" content="{$web_description}">
		<tc_include file="Public:head" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/Index/css/side.css"/>
	</head>

	<body>
		<PHP>ECHO C('REDIS_AUTH');</PHP>
		<tc_include file="Public:nav" />
		<!-- 左侧栏 -->
		<div class="act-mainimg">
			<div class="ju-wrapper">
				<div id="J_actbanner" class="mod-actbanner clearfix">

					<div class="layout-left" id="J_ActCatMenu" data-spm="bnleft">
						<div class="wrap">
							<?php 
			                     $left_silde=sp_get_menu_tree(2);

			                ?>
							<div class="all-sort-list">
								<foreach name="left_silde" item="v" key="k">
									<div class="item">
										<?php 
											$m=0;
                                            if($v['child']){  
										?>
										<h3>
                                           <!--  <i class="fa {$v['icon']}" aria-hidden="true"></i> -->
					                        <foreach name="v['child']" item="vo" key="key"> 
					                        	<?php if($vo['istop']==1){?><neq name="m" value="0">/</neq><a href="<?=$vo['href']?>"><?=$vo['label']?></a><?php } $m++;?>
					                        </foreach>
					                    </h3>
										<?php }else{ ?>
										<h3> <!-- <i class="fa {$v['icon']}" aria-hidden="true"></i> --><a href="{$v['href']}">{$v['label']}</a></h3>
										<?php } ?>
										<div class="item-list clearfix" style="top: 3px; display: none;">
											<div class="close">x</div>
											<div class="subitem">
												<foreach name="v['child']" item="vo" key="key">
													<dl class="fore{$key}">
														<dt><a href="{$vo['href']}">{$vo['label']}</a></dt>
														<dd>
															<foreach name="vo['child']" item="voo" key="keyo">
																<em><a href="{$voo['href']}">{$voo['label']}</a></em>
															</foreach>
														</dd>
													</dl>
												</foreach>
											</div>
										</div>

									</div>
								</foreach>

							</div>

						</div>
					</div>

					<?php 
                     $index_banner=sp_getslide(1);
					  if($index_banner){
                  ?>
					<div class="slideBox_bg">
						<div id="slideBox" class="slideBox">
							<div class="hd">
								<ul>
									<foreach name="index_banner" item="v" key="k">
										<li <eq name="k" value="0"> class="on"</eq>>{$k+1}</li>
									</foreach>
								</ul>
							</div>
							<div class="bd">
								<ul>
									<foreach name="index_banner" item="v" key="k">

										<li <eq name="k" value="0">style="display: list-item;"</eq>
											<neq name="k" value="0">style="display: none;"</neq> >
											<a href="{$v.ad_link}" target="_blank"><img src="{$v.UpFilePathInfo}" alt="pic">
											</a>
										</li>
									</foreach>

								</ul>
							</div>
						</div>
						<!-- 下面是前/后按钮代码，如果不需要删除即可 -->
						<a class="prev" href="javascript:void(0)"></a>
						<a class="next" href="javascript:void(0)"></a>
					</div>
					
						<?php }?>
				</div>
			</div>
		</div>
		<?php 
         $todays=sp_getslide(2);
		  if($todays){
      ?>
		<!-- 今日好价 -->
		<div class="todaysale" style="overflow:hidden;height:251px">
			<a href="">
				<div><img src="__TMPL__Home/Index/imgs/todaysales.jpg" alt="" style="width:200px;height:250px;margin: 0;">
				</div>
			</a>

			<div class="slider1">
				
				<foreach name="todays" item="v" key="k">
					
					<php>
						$id=explode('/',$v['ad_link']);
						$id=$id['4'];
						$id=explode('.',$id);
						$id=$id['0'];
						$rs=shop_type($id);
					</php>
					<a href="{$v.ad_link}" class="todaygoods">
						<div class="slide">
							<div>
								<img src="{$v.UpFilePathInfo}" alt="pic"  >
								<php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: auto;height: auto;top: 0;left: 36px;"><php>}</php>
							</div>
							<div>
								<p><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 0 5px 0 11px;color: #fff;background-size: 100% 100%;margin-right: 5px;">优惠券</em><php>}</php>{$v.ad_title}</p>
								<p class="price">{$v.price}</p>
							</div>
						</div>
					</a>
				
				</foreach>
			
			
			</div>
		</div>
		
			<?php }?>
		<!-- 本地店铺 -->
		<php>
			$local_store=get_local_store();
			if($local_store){
		</php>
		<div class="hotsale_box">
			<h1><span style="color:red;">本地</span>店铺<a href="{:U('store/list_store')}">更多 ></a></h1>
			<div class="hotsale">
				<foreach name="local_store" item="v">
				<a href="{:U('store/index',array('id'=>$v['id']))}" class="hotgoods">
					<div><img src="{$v.portrait}" alt="pic"alt="{$v.title}">
					</div>
					<div>
						<p><eq name="v.quanwang" value="1">【全网】</eq> <eq name="v.quanwang" value="0">【{$v.city_name|default='全国'}】</eq>{$v.title}</p>
						<p><span class="location">{$v.city_name|default='全国'}</span></p>
					</div>
				</a>
				</foreach>
			</div>
		</div>
		<php>}</php>
		<!-- 热门团购 -->
		<div class="hottuan_box">
			<h1>热门团购<span> | HOT DEALS</span></h1>
			<div class="hottuan">
				<foreach name="ptuan" item="v">
					<php>	$rs=shop_type($v['id']);</php>
				<a href="{:U('shop/index',array('id'=>$v['id']))}" class="hottuangoods">
					<div style="position: relative;"><img  src="{$v.image}" alt="pic"   ><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: auto;height: auto;top: 0;left: 35px;">
					</div>
					<div>
						<p><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 0 5px 0 11px;color: #fff;background-size: 100% 100%;margin-right: 5px;">优惠券</em><php>}</php>{$v.title}</p>
						<p class="price">{$v.tuan_price}</p>
						<p><span>去开团</span>
						</p>
					</div>
				</a>
				</foreach>
			</div>
		</div>
		<?php 
         $hot_store=sp_getslide(3);
		 if($hot_store){
      ?>
		
		<!-- 热门店铺 -->
		<div class="onlinehot_box">
			<h1><span>热门店铺</span></h1>
			<div class="onlinehot">
				<foreach name="hot_store" item="v" key="k">
					<a href="{$v.ad_link}">
						<img  src="{$v.UpFilePathInfo}" alt="pic"   alt="{$v.ad_title}">
					</a>
					
				</foreach>
			</div>
		</div>
		<?php }?>
		<!-- 每日团 -->
		<div id="goods_recommend" style="margin-top: 10px;">
			<div class="fixnav">
				<div class="catbg">
					<div class="ju-wrapper">
						<div class="cat-menu-h">
							<p class="ju-icon-juhuasuan h2">
								<a href="">商城推荐</a>
							</p>
							<php>
								$type=$_GET['type'];
								if(!isset($type)){
									$type=session('index_type');
									if(!isset($type)){
										$type=0;
									}
								}
							</php>
							<style type="text/css">
								.cat-menu-h ul li.cur {
								    float: left;
								    background: #ff0000;
								    margin-left: 5px;
								}
							</style>
							<ul class="clearfix">
								<li <eq name="type" value="0">class="cur"</eq>> 
									<a href="{:U('index/index',array('type'=>0))}">综合</a>
								</li>
								<li <eq name="type" value="1">class="cur"</eq>>
									<a href="{:U('index/index',array('type'=>1))}">人气 </a>
								</li>
								<li <eq name="type" value="2">class="cur"</eq>>
									<a href="{:U('index/index',array('type'=>2))}">上架时间</a>
								</li>
								<li <eq name="type" value="3">class="cur"</eq>>
									<a href="{:U('index/index',array('type'=>3))}">销量</a>
								</li>
								<li <eq name="type" value="4">class="cur"</eq>>
									<a href="{:U('index/index',array('type'=>4))}">价格 </a>
								</li>

							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--   产品 -->
		<div class="ju-wrapper_box">
			<div class="ju-wrapper">
				<div class="ju-itemlist" data-spm="102212b" data-spm-max-idx="96">
					<ul id="juList" class="clearfix">
						<foreach name="recommend" item="v">
							<php>$rs=shop_type($v['id']);</php>
						<li class="item-small-v3" data-juid="10000050017725">
							<php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;"><php>}</php>
							<div class="status-avil">
								<a href="{:U('shop/index',array('id'=>$v['id']))}" class="link-box " target="_blank" data-spm-anchor-id="608.6941085.102212b.1">
									<img  src="{$v.image}" alt="pic"  style="height: 390px;width: 390px;">
								</a>
								<h3 class="nowrap" title=""><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 0 5px 0 11px;color: #fff;background-size: 100% 100%;margin-right: 5px;">优惠券</em><php>}</php>{$v['title']}</h3>
								<p style="padding: 0 10px;height: 18px;">
									<notempty name="rs['story']">
									<a href="{:U('shop/store',array('id'=>$v['id']))}" style="color: red;text-decoration: underline;height: 20px;overflow: hidden;display: block;white-space: nowrap;word-break: keep-all;text-overflow: ellipsis;">{$rs['story']}</a>
									</notempty>
								</p>
								<p class="til_price">
									<span class="">￥{$v['price']}</span>
									<span><a class="add_car" href="{:U('shop/index',array('id'=>$v['id']))}"></a></span>
									<php>if($v['envelope_type']==0){</php>
										<gt name="v['redenvelope']" value="0">
										<php>
											if($web_daiyan>=$v['redenvelope']){
												$v['redenvelope']=round($v['redenvelope']/$v['price'] * 100 , 2) . "％";
											}else{
												$v['redenvelope']='￥'.$v['redenvelope'];
											}
										</php>

										<span data="{$web_daiyan}">代言红包：{$v['redenvelope']}</span>
										</gt>
									<php>}</php>
									<php>if($v['envelope_type']==1&&$v['envelope_type']!=0){</php>
									<gt name="v['redenvelope']" value="0">
										<span data="{$web_daiyan}">代言大礼包</span>
									</gt>
									<php>}</php>
								</p>
							</div>
						</li>
						</foreach>
					</ul>
				</div>
			</div>
		</div>
		<!-- 猜你喜欢 -->
		<div class="youlike">
			<div class="like">
				<p><span><i></i>猜你喜欢</span>
				</p>
			</div>
			<p>实时推荐最适合你的宝贝</p>
			<div class="like_goods">
				<foreach name="like_list" item="v">
					<php>$rs=shop_type($v['id']);</php>

					<a href="{:U('shop/index',array('id'=>$v['id']))}" class="like_good">
						<div>
							<php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: auto; height: auto;"><php>}</php>
							<img src="{$v.image}" alt="pic"  />
						</div>
						<div style="overflow: hidden;">
							<p>
								<php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 0 5px 0 11px;color: #fff;background-size: 100% 100%;margin-right: 5px;">优惠券</em><php>}</php>
								{$v['title']}
							</p>

						     <p class="price">{$v['price']}</p>

						</div>
					</a>
				</foreach>
			</div>
		</div>

		<!-- 底部 -->
		<tc_include file="Public:footer" />
		<tc_include file="Public:right" />
				<script type="text/javascript" src="/themes/wnsc/Home/Index/js/jquery.bxslider.js"></script>
		<script type="text/javascript" src="/themes/wnsc/Home/Index/js/jquery.easing.min.js"></script>
		<script>
			//轮播
			jQuery(".slideBox").slide({
				mainCell: ".bd ul",
				autoPlay: true
			});
			<php>if(isset($_GET['type'])){</php>
			
			$(function(){
				 $("html, body").scrollTop(0).animate({scrollTop: $("#goods_recommend").offset().top});
			})
		
			<php>}</php>
		</script>
		<script>
			$(document).ready(function(){
				$('.slider1').bxSlider({
					slideWidth: 200,
		 			minSlides: 5,
					maxSlides: 5,
		           movSlides: 5,
		            
				});
			});
		</script>

		<php>if($rs_d_city){</php>
		<script>
            $(function () {

                //询问框
                layer.confirm('系统检测您在{$rs_d_city.city_name},是否需要切换？', {
                    btn: ['是的','不需要'] //按钮
                }, function(){
                    location.href='/index/subsite/type/1/id/{$rs_d_city.city_id}.html';
                }, function(){
                    location.href='/index/subsite/type/2.html';
                });
            })

		</script>
		<php>}</php>
	</body>

</html>